<?php

namespace App\CustHub\Mapper;

use App\CustHub\Model\ChDevelopmentCourse;
use Mine\Abstracts\AbstractMapper;
use Mine\Exception\NormalStatusException;

class ChDevelopCourseMapper extends AbstractMapper
{
    public function assignModel()
    {
        $this->model = ChDevelopmentCourse::class;
    }

    public function delete(array $ids): bool
    {
        $delete = $this->model::query()
            ->whereIn('id', $ids)
            ->delete();
        if (!$delete) {
            throw new NormalStatusException("删除失败");
        }
        return true;
    }
}